import http from "@/api";

/**
 * 广告位列表
 */
export const advertiseSpaceListApi = (params: object) => {
    return http.get(`/advertise/space/list`, params);
};

/**
 * 广告位分页列表
 */
export const advertiseSpacePageListApi = (params: object) => {
    return http.get(`/advertise/space/paging`, params);
};

/**
 * 新增广告位
 * @param params
 */
export const addAdvertiseSpaceApi = (params: object) => {
    return http.post(`/advertise/space/add`, params);
};

/**
 * 编辑广告位
 * @param params
 */
export const editAdvertiseSpaceApi = (params: any) => {
    return http.put(`/advertise/space/edit/${params.id}`, params);
};

/**
 * 切换广告位状态
 * @param id
 */
export const changeStatusApi = (id: number) => {
    return http.put(`/advertise/space/change_status/${id}`);
};

/**
 * 修改限制广告数量
 * @param params
 */
export const changeLimitApi = (params: object) => {
    return http.post(`/advertise/space/changeLimit`, params);
};

/**
 * 删除广告位
 * @param id
 */
export const deleteAdvertiseSpaceByIdApi = (id: number) => {
    return http.delete(`/advertise/space/delete/${id}`);
};

/**
 * 批量删除
 * @param params
 */
export const deleteAdvertiseSpaceApi = (params: object) => {
    return http.post(`/advertise/space/delete`, params);
};
